from flask import jsonify
import functools

def domain(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        result = func(*args, **kwargs)
        resp = jsonify(data=result)
        resp.headers['Access-Control-Allow-Origin'] = '*'
        return resp
    return wrapper